package inner_package;

public class StaticClass {
    private static int numT = 100;
    private String msg = "outer中的成员变量msg";
    // 静态内部类就是一个普通类，只是把它套在类outer中而已
    static class Inner {
        private int num = 10;
        public void test() {
            System.out.println(numT);
//            System.out.println(msg); // 错误不能直接访问外部类的成员域，需要通过外部类对象调用
            System.out.println(new StaticClass().msg);
        }
    }
    public void fun() {
        Inner inner = new Inner(); // 外部类的内部产生静态内部类对象
    }
}

class Test1 {
    public static void main(String[] args) {
        StaticClass.Inner inner = new StaticClass.Inner();
    }
}

